-
Notifications
You must be signed in to change notification settings - Fork 3.8k
CASSANDRA-20752: Add SSTableFlushObserver#onSSTableWriterSwitched #4380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
9981933
to
c446387
Compare
src/java/org/apache/cassandra/index/sai/disk/v1/segment/SegmentBuilder.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/index/sai/functional/CompactionTest.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/index/sai/functional/CompactionTest.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/io/sstable/SSTableFlushObserverTest.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/v1/SSTableIndexWriter.java
Outdated
Show resolved
Hide resolved
boolean emptySegment = currentBuilder == null || currentBuilder.isEmpty(); | ||
logger.debug("Flushing index {} with {}buffered data on sstable writer switched...", index.identifier().indexName, emptySegment ? "no " : ""); | ||
if (!emptySegment) | ||
flushSegment(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that we don't have to aggressively create a new builder here because addTerm()
, complete()
, and abort()
will all handle the currentBuilder == null
case appropriately.
src/java/org/apache/cassandra/index/sai/disk/PerColumnIndexWriter.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/PerColumnIndexWriter.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/StorageAttachedIndexWriter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped some comments throughout the PR. We should probably also make sure we don't refer to CNDB-14725 in the commit message ;)
5f2deb4
to
55d7132
Compare
… SAI segment builder for written shards without waiting for entire transaction to complete (apache#1859) This reduces memory usage during sharded compaction. riptano/cndb#14725 OOM during SAI compaction with large num of shards Flush segment builder when sstable writer is switched to free memory without waiting full compaction to complete
55d7132
to
27dbb77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
add SSTableFlushObserver#onSSTableWriterSwitched to flush SAI segment builder for written shards without waiting for entire transaction to complete
This reduces memory usage during sharded compaction.
The Cassandra Jira